using System;
using System.Collections.Generic;
using System.Text;
using NHibernate;
using MemberMgr.Data.BusinessObjects;
using MemberMgr.Data.Base;

namespace MemberMgr.Data.ManagerObjects
{
    public partial interface ItConsumptionMasterManager : IManagerBase<tConsumptionMaster, uint>
    {
		// Get Methods
		IList<tConsumptionMaster> GetByMEMBERID(System.UInt32 tMember);
		IList<tConsumptionMaster> GetBySHOPID(System.UInt32 tShop);
    }

    partial class tConsumptionMasterManager : ManagerBase<tConsumptionMaster, uint>, ItConsumptionMasterManager
    {
		#region Constructors
		
		public tConsumptionMasterManager() : base()
        {
        }
        public tConsumptionMasterManager(INHibernateSession session) : base(session)
        {
        }
		
		#endregion
		
        #region Get Methods

		
		public IList<tConsumptionMaster> GetByMEMBERID(System.UInt32 tMember)
        {
            ICriteria criteria = Session.GetISession().CreateCriteria(typeof(tConsumptionMaster));
			
			
			ICriteria tMemberCriteria = criteria.CreateCriteria("TMember");
            tMemberCriteria.Add(NHibernate.Criterion.Expression.Eq("Id", tMember));
			
			return criteria.List<tConsumptionMaster>();
        }
		
		public IList<tConsumptionMaster> GetBySHOPID(System.UInt32 tShop)
        {
            ICriteria criteria = Session.GetISession().CreateCriteria(typeof(tConsumptionMaster));
			
			
			ICriteria tShopCriteria = criteria.CreateCriteria("TShop");
            tShopCriteria.Add(NHibernate.Criterion.Expression.Eq("Id", tShop));
			
			return criteria.List<tConsumptionMaster>();
        }
		
		#endregion
    }
}